package org.example.DesignPatterns.ChainOfResponsibility;

/**
 * @description:
 * @author: farprt
 * @create: 2022-09-20 20:57
 **/
public class Client {

    public static void main(String[] args) {
//        int amount=10000;
//        Staff staff=new Staff("张三");
//        if(!staff.approve(amount)){
//            Manager manager=new Manager("李四");
//            if(!manager.approve(amount)){
//                CEO ceo=new CEO("a");
//                ceo.approve(amount);
//            }
//        }
        Approver zhangSan=new Staff("张三");
        //设置责任链
        zhangSan.setNextApprover(new Manager("李四")).setNextApprover(new CEO("王五"));

        zhangSan.approve(10000);



    }
}